import request from '@/utils/request.js'

//分页
export function getList(query) {
    return request({
        url: '/product/categoryBrand/list',
        method: 'get',
        params: query
    })
}

//根据id获取详情
export function getById(id) {
    return request({
        url: `/product/categoryBrand/${id}`,
        method: 'get'
    })
}

//添加分类品牌
export function addCategoryBrand(data) {
    return request({
        url: '/product/categoryBrand',
        method: 'post',
        data: data
    })
}

//修改分类品牌
export function editCategoryBrand(data) {
    return request({
        url: '/product/categoryBrand',
        method: 'put',
        data: data
    })
}

//删除分类品牌
export function removeCategoryBrand(ids) {
    return request({
        url: `/product/categoryBrand/${ids}`,
        method: 'delete'
    })
}

//根据分类id获取品牌列表
export function getBrandCategoryById(id){
    return request({
        url:`/product/categoryBrand/brandList/${id}`,
        method:'get',
    })
}

// 根据分类获取分类品牌
export function getCategoryBrandAll(categoryId) {
    return request({
        url: '/product/categoryBrand/brandList/' + categoryId,
        method: 'get'
    })
}